Improve poll dialogs TalkBack accessibility#6466
Conversation
|
@CodeRabbit review |
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
✅ Actions performedReview triggered.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThis PR improves accessibility across six poll UI components in Stream Chat Android Compose by adding semantics imports, marking dialog titles as headings with announcements, grouping content with merged-descendants semantics, and enhancing vote interaction with dynamic toggle roles and pluralized semantic descriptions for screen readers. ChangesPoll Accessibility Enhancements
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
SDK Size Comparison 📏
|
After extracting PollOptionVotingRow, PollOptionItem became a pass-through that forwards twelve parameters with no transformation. Inline the call site to use PollOptionVotingRow directly and drop the wrapper along with its LongParameterList suppression.
|
When the emoji picker `ModalBottomSheet` opened from the "+" in the reactions bar, TalkBack focused the drag handle and announced "Collapsed, drag handle, actions available, swipe up or swipe down". Screen-reader users had no signal that the emoji picker had appeared and the drag handle drowned out the actual content. `ModalBottomSheet` swallows the standard `paneTitle` window-state event (verified in #6466 / `PollDialogHeader`), so announce the title programmatically via `view.announceForAccessibility` in a `LaunchedEffect`. TalkBack now reads "Emoji picker" on sheet open. Hide the drag handle from the accessibility tree via `Modifier.semantics { hideFromAccessibility() }`. The handle stays visually present and remains draggable for sighted users; TalkBack focus skips it and lands on the first emoji in the picker grid instead. One new string (`stream_compose_emoji_picker_title`) translated across the 7 supported locales. No public API changes.
|
🚀 Available in v7.3.0 |


AND-1180
Goal
The poll-results bottom sheet, the per-option votes screen, the comments dialog, and the more-options dialog were hard to navigate with TalkBack: the screen title wasn't announced on open, sub-section labels weren't navigable as headings, vote/comment rows produced one focus per child element (avatar, name, date), and the radio/checkbox in the more-options dialog was unlabeled. This PR fixes all of that so each row is a single focus with a meaningful announcement, and dialog titles identify their screen.
Implementation
PollDialogHeader(shared by all four poll dialogs): titleTextcarriesheading()semantics, and the header sends a programmaticview.announceForAccessibility(title)on first composition.ModalBottomSheetswallows the standardpaneTitlewindow-state-changed event, so programmatic announce is the reliable workaround.PollVoteItem(shared by results + per-option votes screens): the row merges its descendants so each vote announces as one focus (avatar + name + date).PollViewResultDialog: option header (Option N) + summary row (option text + winner badge + vote count) wrapped in a mergedColumnwithheading()— one focus per option summary, navigable via TalkBack's heading shortcut. Question section also merged withheading().PollOptionVotesDialog: the trophy-and-vote-count header row above the votes list is merged.PollAnswers: each comment card merges the answer text with the user/timestamp row into one focus; the "Update Your Comment" button stays as its own separate focus.PollMoreOptionsDialog: applies the same pattern as the just-merged inline poll (PollMessageContent, Improve poll vote row TalkBack accessibility #6461): each option row istoggleablewithRole.RadioButton(single-vote polls) orRole.Checkbox(multi-vote), theRadioCheckis hidden from accessibility since the toggleable row already conveys state, the vote count gets a pluralcontentDescription, and theLinearProgressIndicatoris removed from the semantics tree (the row already carries the count). Question section also merged withheading().No visible UI changes; layout, colours, and behaviour are unchanged.
Testing
Summary by CodeRabbit